/*
 *------------------------------------------------------------------------------
 * @File      :    ei_mai_camera.h
 * @Date      :    2021-4-8
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media Interface for MADP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */

#ifndef __EI_MAI_CAMERA_H__
#define __EI_MAI_CAMERA_H__

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

#include "ei_mai_comm_define.h"
#include "ei_mai_common.h"
#include "ei_comm_video.h"
#include "ei_comm_viss.h"
#include "ei_comm_camera.h"
#include "ei_mai_camera_define.h"

#define CAMERA_NUM 2

typedef struct eiSAMPLE_SENSOR_INFO_S {
	SNS_TYPE_E   enSnsType;
	EI_S32              s32SnsId;
	EI_S32              s32BusId;
	VISS_DEV_TYPE_E           enDevType;
} SAMPLE_SENSOR_INFO_S;

typedef struct eiSAMPLE_DEV_INFO_S {
	VISS_DEV    VissDev;
	WDR_MODE_E  enWDRMode;
	VISS_OUT_PATH_E         enOutPath;    /* 0: DMA 1:ISP */
} SAMPLE_DEV_INFO_S;

typedef struct eiSAMPLE_ISP_INFO_S {
	ISP_DEV             IspDev;
	EI_BOOL             bIspBypass;
	ISP_RUNNING_MODE_E  enRunningMode;
} SAMPLE_ISP_INFO_S;

typedef struct eiSAMPLE_CHN_INFO_S {
	VISS_CHN            aVissChn[VISS_DEV_MAX_CHN_NUM];
	VISS_WORK_MODE_E    enWorkMode;
	PIXEL_FORMAT_E      enPixFormat;
	VIDEO_FORMAT_E      enVideoFormat;
	COMPRESS_MODE_E     enCompressMode;
} SAMPLE_CHN_INFO_S;

typedef enum eiMODULE_STATUS_E {
	STATUS_NOTINIT,
	STATUS_STOPPED,
	STATUS_RUNNING,
	STATUS_BUTT
} MODULE_STATUS_E;

typedef struct eiSAMPLE_VISS_INFO_S {
	MODULE_STATUS_E envCameraStatus;
	SAMPLE_SENSOR_INFO_S    stSnsInfo;
	SAMPLE_DEV_INFO_S       stDevInfo;
	SAMPLE_ISP_INFO_S       stIspInfo;
	SAMPLE_CHN_INFO_S       stChnInfo;
} EI_CAMERA_INNER_ATTR_S;

EI_S32 EI_MAI_Camera_Init(EI_VOID);
EI_S32 EI_MAI_Camera_SetAttr(EI_HANDLE CameraHdl, EI_MADP_CAMERA_ATTR_S* pstCameraAttr);
EI_S32 EI_MAI_Camera_GetAttr(EI_HANDLE CameraHdl, EI_MADP_CAMERA_ATTR_S *pstCameraAttr);
EI_S32 EI_MAI_Camera_Start(EI_HANDLE CameraHdl);
EI_S32 EI_MAI_Camera_Stop(EI_HANDLE CameraHdl);
EI_S32 EI_MAI_Camera_SetAttrEx(EI_HANDLE CameraHdl, EI_HANDLE VPortHdl, EI_MADP_CAMERA_CMD_E enCMD, CAMERA_ATTREX_S *pstAttrEx);
EI_S32 EI_MAI_Camera_SetExtDevAttr(EI_HANDLE CameraHdl,const CTL_ATTR_S *pstCtlAttr);
EI_S32 EI_MAI_Camera_GetExtDevAttr(EI_HANDLE CameraHdl, CTL_ATTR_S *pstCtlAttr);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif

#endif

